package com.skivingcloud.camunda.controller;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.skivingcloud.admin.sys.entity.User;
import com.skivingcloud.admin.utils.UserUtil;
import com.skivingcloud.camunda.service.ModelService;
import com.skivingcloud.common.utils.PageUtils;
import com.skivingcloud.common.utils.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 流程模型设计
 * @author hushouquan
 */
@RestController
@RequestMapping("/workflow")
public class ModelController{
    protected static final Logger log = LoggerFactory.getLogger(ModelController.class);
    
    @Autowired
    private ModelService modelService;
    
    /**
     * 查询模型列表
     * @param params
     * @return
     */
    @GetMapping("/model/list")
    public R list(@RequestParam Map<String, Object> params) {
        User user = UserUtil.getUser();
        PageUtils pageUtil = modelService.list(params, user);
        return R.ok().put("page", pageUtil);
    }
}
